package biz.obake.team.touchprotector.ui;

import android.content.Intent;
import android.os.Bundle;
import biz.obake.team.touchprotector.R;
import biz.obake.team.touchprotector.tpas.TPAccessibilityService;

public class Tab_Advanced extends a {
    private void bringToFrontIfThisTabIsSelected() {
        MainActivity mainActivity = (MainActivity) getActivity();
        if ("Tab_Advanced".equals(mainActivity.L())) {
            Intent intent = new Intent(mainActivity, MainActivity.class);
            intent.setFlags(131072);
            startActivity(intent);
        }
    }

    public void onCreatePreferences(Bundle bundle, String str) {
        setPreferencesFromResource(R.xml.ui_tab_advanced, str);
        if (TPAccessibilityService.i()) {
            prefRemove("advanced");
            prefEnable("stabilize_sensors", true);
            prefSwitch("stabilize_sensors", true);
            prefEnable("video", true);
            prefSwitch("video", true);
            prefEnable("nolockapps", true);
            prefEnable("lock_volup_twice", true);
            prefEnable("lock_voldown_twice", true);
            prefEnable("toggle_sensor_volupdown", true);
            return;
        }
        prefSwitch("stabilize_sensors", false);
        prefSwitch("video", false);
    }

    /* access modifiers changed from: protected */
    /* JADX WARNING: Removed duplicated region for block: B:12:0x0028 A[ADDED_TO_REGION] */
    /* JADX WARNING: Removed duplicated region for block: B:15:0x0035 A[ADDED_TO_REGION] */
    /* JADX WARNING: Removed duplicated region for block: B:18:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void onPrefChanged(android.content.SharedPreferences r5, java.lang.String r6) {
        /*
            r4 = this;
            int r0 = r6.hashCode()
            r1 = 109573129(0x687f409, float:5.1139933E-35)
            r2 = 0
            r3 = 1
            if (r0 == r1) goto L_0x001b
            r1 = 112202875(0x6b0147b, float:6.6233935E-35)
            if (r0 == r1) goto L_0x0011
            goto L_0x0025
        L_0x0011:
            java.lang.String r0 = "video"
            boolean r0 = r6.equals(r0)
            if (r0 == 0) goto L_0x0025
            r0 = 1
            goto L_0x0026
        L_0x001b:
            java.lang.String r0 = "stabilize_sensors"
            boolean r0 = r6.equals(r0)
            if (r0 == 0) goto L_0x0025
            r0 = 0
            goto L_0x0026
        L_0x0025:
            r0 = -1
        L_0x0026:
            if (r0 == 0) goto L_0x002b
            if (r0 == r3) goto L_0x002b
            goto L_0x0040
        L_0x002b:
            boolean r0 = biz.obake.team.touchprotector.tpas.TPAccessibilityService.i()
            boolean r5 = r5.getBoolean(r6, r2)
            if (r0 == 0) goto L_0x0040
            if (r5 != 0) goto L_0x0040
            r4.prefSwitch(r6, r3)
            r5 = 2131624303(0x7f0e016f, float:1.8875782E38)
            biz.obake.team.touchprotector.g.e.a(r5)
        L_0x0040:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: biz.obake.team.touchprotector.ui.Tab_Advanced.onPrefChanged(android.content.SharedPreferences, java.lang.String):void");
    }

    /* access modifiers changed from: protected */
    public void onRamPrefChanged(String str) {
        if (((str.hashCode() == 1469327921 && str.equals("TPAS.State")) ? (char) 0 : 65535) == 0) {
            reloadSelf();
            bringToFrontIfThisTabIsSelected();
        }
    }
}
